<?php

class Mageex_AdvancedMenu_Block_Adminhtml_AdvancedMenu_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
{
  protected function _prepareForm()
  {
      $form = new Varien_Data_Form();
      $this->setForm($form);
      $fieldset = $form->addFieldset('advancedmenu_form', array('legend'=>Mage::helper('advancedmenu')->__('Item information')));
     
      $fieldset->addField('name', 'text', array(
          'label'     => Mage::helper('advancedmenu')->__('Name'),
          'class'     => 'required-entry',
          'required'  => true,
          'name'      => 'name',
      ));
	 $fieldset->addField('url_key', 'text', array(
          'label'     => Mage::helper('advancedmenu')->__('URL Key'),
          'required'  => false,
          'name'      => 'url_key',
      ));	
	  $fieldset->addField('order', 'text', array(
          'label'     => Mage::helper('advancedmenu')->__('Item Index'),
          'required'  => true,
		  'class'     => 'required-entry',
          'name'      => 'order',
      ));	
	  $fieldset->addField('css_id', 'text', array(
          'label'     => Mage::helper('advancedmenu')->__('Item CSS ID'),
          'required'  => false,
          'name'      => 'css_id',
      ));
	 $fieldset->addField('css_class', 'text', array(
          'label'     => Mage::helper('advancedmenu')->__('Item CSS Class'),
          'required'  => false,
          'name'      => 'css_class',
      ));
	  $fieldset->addField('static_block', 'select', array(
          'label'     => Mage::helper('advancedmenu')->__('Static Block'),
          'required'  => false,
		  'values'    => Mage::getSingleton('advancedmenu/cms_list')->getBlockList(),
          'name'      => 'static_block',
      ));
	  $fieldset->addField('store_id', 'select', array(
          'label'     => Mage::helper('advancedmenu')->__('Store View'),
          'required'  => true,
		  'class'     => 'required-entry',
		  'values'    => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true),
          'name'      => 'store_id',
      ));
      $fieldset->addField('status', 'select', array(
          'label'     => Mage::helper('advancedmenu')->__('Status'),
          'name'      => 'status',
          'values'    => array(
              array(
                  'value'     => 1,
                  'label'     => Mage::helper('advancedmenu')->__('Enabled'),
              ),

              array(
                  'value'     => 2,
                  'label'     => Mage::helper('advancedmenu')->__('Disabled'),
              ),
          ),
      ));
     
      if ( Mage::getSingleton('adminhtml/session')->getAdvancedMenuData() )
      {
          $form->setValues(Mage::getSingleton('adminhtml/session')->getAdvancedMenuData());
          Mage::getSingleton('adminhtml/session')->setAdvancedMenuData(null);
      } elseif ( Mage::registry('advancedmenu_data') ) {
          $form->setValues(Mage::registry('advancedmenu_data')->getData());
      }
      return parent::_prepareForm();
  }
}